/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package project1;

import static project1.Frame.*;
import project1.Project1;
import project1.SqlFunc;

/**
 *
 * @author haihip
 */
public class AccountView extends javax.swing.JPanel {

    /**
     * Creates new form AccountView
     */
    public AccountView() {
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
        }
        initComponents();
        hideAdmin();
        
        loadInfo();
    }
    SqlFunc sql = new SqlFunc();
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        AddAccountDlg = new javax.swing.JDialog();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        btn_home = new javax.swing.JLabel();
        txt_home = new javax.swing.JLabel();
        btn_editaccount = new javax.swing.JLabel();
        txt_editaccount = new javax.swing.JLabel();
        btn_addaccount = new javax.swing.JLabel();
        txt_addaccount = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        txt_hoten = new javax.swing.JTextField();
        txt_dob = new javax.swing.JTextField();
        txt_sdt = new javax.swing.JTextField();
        txt_sex = new javax.swing.JTextField();
        txt_quequan = new javax.swing.JTextField();
        txt_email = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        info0 = new javax.swing.JLabel();
        info1 = new javax.swing.JLabel();
        info2 = new javax.swing.JLabel();
        info3 = new javax.swing.JLabel();
        info4 = new javax.swing.JLabel();
        btn_edited = new javax.swing.JButton();

        AddAccountDlg.setTitle("Thêm tài khoản");
        AddAccountDlg.setAlwaysOnTop(true);
        AddAccountDlg.setMinimumSize(new java.awt.Dimension(500, 600));
        AddAccountDlg.setResizable(false);
        AddAccountDlg.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                AddAccountDlgWindowClosing(evt);
            }
        });

        javax.swing.GroupLayout AddAccountDlgLayout = new javax.swing.GroupLayout(AddAccountDlg.getContentPane());
        AddAccountDlg.getContentPane().setLayout(AddAccountDlgLayout);
        AddAccountDlgLayout.setHorizontalGroup(
            AddAccountDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 500, Short.MAX_VALUE)
        );
        AddAccountDlgLayout.setVerticalGroup(
            AddAccountDlgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );

        setMaximumSize(new java.awt.Dimension(1024, 700));
        setMinimumSize(new java.awt.Dimension(1024, 700));

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        jPanel2.setBackground(new java.awt.Color(250, 249, 249));
        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setPreferredSize(new java.awt.Dimension(1024, 124));

        btn_home.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        btn_home.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project1/Views/images/home.png"))); // NOI18N
        btn_home.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        btn_home.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btn_home.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btn_home.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btn_homeMouseClicked(evt);
            }
        });

        txt_home.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        txt_home.setText("Thông tin chung");

        btn_editaccount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project1/Views/images/edit.png"))); // NOI18N
        btn_editaccount.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btn_editaccountMouseClicked(evt);
            }
        });

        txt_editaccount.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        txt_editaccount.setText("Sửa thông tin");

        btn_addaccount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project1/Views/images/new_account.png"))); // NOI18N
        btn_addaccount.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btn_addaccountMouseClicked(evt);
            }
        });

        txt_addaccount.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        txt_addaccount.setText("Thêm tài khoản");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(btn_home)
                    .addComponent(txt_home))
                .addGap(55, 55, 55)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btn_editaccount)
                    .addComponent(txt_editaccount))
                .addGap(55, 55, 55)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txt_addaccount)
                    .addComponent(btn_addaccount))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btn_editaccount)
                            .addComponent(btn_addaccount))
                        .addGap(0, 0, 0)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txt_editaccount)
                            .addComponent(txt_addaccount)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(btn_home)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txt_home)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Thông tin tài khoản"));
        jPanel3.setMaximumSize(new java.awt.Dimension(955, 514));
        jPanel3.setMinimumSize(new java.awt.Dimension(955, 514));

        jLabel15.setBackground(new java.awt.Color(204, 204, 204));
        jLabel15.setText("Ảnh đại diện. Size 100 x 150");
        jLabel15.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLabel15.setFocusable(false);
        jLabel15.setMaximumSize(new java.awt.Dimension(100, 150));
        jLabel15.setMinimumSize(new java.awt.Dimension(100, 150));
        jLabel15.setPreferredSize(new java.awt.Dimension(100, 150));

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel5.setText("Họ và tên:");

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel1.setText("Ngày sinh:");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setText("Số điện thoại:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel3.setText("Giới tính:");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel4.setText("Quê quán:");

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel6.setText("Email:");

        txt_hoten.setEditable(false);

        txt_dob.setEditable(false);

        txt_sdt.setEditable(false);

        txt_sex.setEditable(false);

        txt_quequan.setEditable(false);

        txt_email.setEditable(false);

        jPanel4.setBackground(new java.awt.Color(255, 255, 255));
        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel4.setMaximumSize(new java.awt.Dimension(640, 243));
        jPanel4.setMinimumSize(new java.awt.Dimension(640, 243));

        info0.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        info0.setText("jLabel7");

        info1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        info1.setText("jLabel7");

        info2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        info2.setText("jLabel7");

        info3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        info3.setText("jLabel7");

        info4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        info4.setText("jLabel7");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(127, 127, 127)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(info4)
                    .addComponent(info3)
                    .addComponent(info2)
                    .addComponent(info1)
                    .addComponent(info0))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(info0)
                .addGap(18, 18, 18)
                .addComponent(info1)
                .addGap(18, 18, 18)
                .addComponent(info2)
                .addGap(18, 18, 18)
                .addComponent(info3)
                .addGap(18, 18, 18)
                .addComponent(info4)
                .addContainerGap(76, Short.MAX_VALUE))
        );

        btn_edited.setText("Lưu sửa đổi");
        btn_edited.setVisible(false);
        btn_edited.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_editedActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(253, 253, 253)
                        .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel1))
                                .addGap(30, 30, 30)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txt_hoten)
                                    .addComponent(txt_dob, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel6))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_sdt)
                                    .addComponent(txt_quequan)
                                    .addComponent(txt_email)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(txt_sex, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(0, 0, Short.MAX_VALUE)))))
                        .addGap(47, 47, 47)
                        .addComponent(btn_edited, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 9, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(155, 155, 155)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(155, 155, 155))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(txt_hoten, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(txt_dob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(txt_sdt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(txt_sex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel4)
                                    .addComponent(txt_quequan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(9, 9, 9)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel6)
                                    .addComponent(txt_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(btn_edited, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap(31, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(26, 26, 26))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(0, 30, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents
    public final void loadInfo()
    {
            String[] u = project1.Project1.User;
            txt_hoten.setText(u[2]);
            txt_dob.setText(u[3]);
            txt_email.setText(u[7]);
            txt_quequan.setText(u[5]);
            txt_sdt.setText(u[6]);
            txt_sex.setText(u[4]);
            System.out.println(u[9]+"-");
            switch (u[9]) {
                case "1":
                    info0.setText("Số hiệu sinh viên: "+u[10]);
                    info1.setText("Ngành học: "+u[11]);
                    info2.setText("Khoá học: "+u[12]);
                    info0.setVisible(true);
                    info1.setVisible(true);
                    info2.setVisible(true);
                    info3.setVisible(false);
                    info4.setVisible(false);
                    break;
                case "2":
                    info0.setText("Mã số giảng viên: "+u[10]);
                    info1.setText("Bộ môn: "+u[11]);
                    info0.setVisible(true);
                    info1.setVisible(true);
                    info2.setVisible(false);
                    info3.setVisible(false);
                    info4.setVisible(false);
                    break;
            }
    }
    private void btn_homeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_homeMouseClicked
        // TODO add your handling code here:
        System.out.println(Project1.User[9]);
        switch (Project1.User[9]) {
            case "1":
                project1.Frame.setFrame(homeView);
                break;
            case "2":
                project1.Frame.setFrame(gvHomeView);
                break;
        }
    }//GEN-LAST:event_btn_homeMouseClicked

    private void btn_addaccountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_addaccountMouseClicked
        // TODO add your handling code here:
        project1.Frame.homeFrame.setEnabled(false);
        AddAccountDlg.setVisible(true);
        AddAccountDlg.setLocationRelativeTo(null);
        AddAccountDlg.setAlwaysOnTop(true);
    }//GEN-LAST:event_btn_addaccountMouseClicked

    private void AddAccountDlgWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_AddAccountDlgWindowClosing
        // TODO add your handling code here:
        AddAccountDlg.setAlwaysOnTop(false);
        project1.Frame.homeFrame.setEnabled(true);
    }//GEN-LAST:event_AddAccountDlgWindowClosing

    private void btn_editaccountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_editaccountMouseClicked
        if(Project1.User[9].equals("1") || Project1.User[9].equals("2"))
        {
            txt_email.setEditable(true);
            txt_sdt.setEditable(true);
        }
        btn_edited.setVisible(true);
    }//GEN-LAST:event_btn_editaccountMouseClicked

    private void btn_editedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_editedActionPerformed
        if(Project1.User[9].equals("1") || Project1.User[9].equals("2"))
        {
            if(!txt_email.getText().isEmpty())
                Project1.User[7]=txt_email.getText();
            if(!txt_sdt.getText().isEmpty())
                Project1.User[6]=txt_sdt.getText();
            txt_email.setEditable(false);
            txt_sdt.setEditable(false);
            System.out.println("update user set email='"+Project1.User[7]+"', dienthoai='"+Project1.User[6]+"' where ID_User='"+Project1.User[1]+"'");
            sql.query("update user set email='"+Project1.User[7]+"', dienthoai='"+Project1.User[6]+"' where ID_User='"+Project1.User[1]+"'");
            loadInfo();
            btn_edited.setVisible(false);
        }
    }//GEN-LAST:event_btn_editedActionPerformed
    private void hideAdmin()
    {
        if(Project1.User[9].equals("3"))
        {
            btn_addaccount.setVisible(true);
            txt_addaccount.setVisible(true);
        }
        else
        {
            btn_addaccount.setVisible(false);
            txt_addaccount.setVisible(false);
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDialog AddAccountDlg;
    private javax.swing.JLabel btn_addaccount;
    private javax.swing.JLabel btn_editaccount;
    private javax.swing.JButton btn_edited;
    private javax.swing.JLabel btn_home;
    private javax.swing.JLabel info0;
    private javax.swing.JLabel info1;
    private javax.swing.JLabel info2;
    private javax.swing.JLabel info3;
    private javax.swing.JLabel info4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JLabel txt_addaccount;
    private javax.swing.JTextField txt_dob;
    private javax.swing.JLabel txt_editaccount;
    private javax.swing.JTextField txt_email;
    private javax.swing.JLabel txt_home;
    private javax.swing.JTextField txt_hoten;
    private javax.swing.JTextField txt_quequan;
    private javax.swing.JTextField txt_sdt;
    private javax.swing.JTextField txt_sex;
    // End of variables declaration//GEN-END:variables
}
